import Axios from '../index'
import conf from '../../config'

class ProductCS {

  /**
   *
   * @param params
   * @returns 查询客服本次上线的客户记录及未读消息数量
   * @constructor
   */
  async guestUser(params) {
    return await Axios.get({
      url: conf.UrlList.guestUser,
      data: params
    })
  }
  /**
   *
   * @param params
   * @returns 查询客户得订单信息
   * @constructor
   */
  async guestOrder(params) {
    return await Axios.get({
      url: conf.UrlList.guestOrder,
      data: params
    })
  }
  /**
   *
   * @param params
   * @returns 查询客户个人信息(需要token)
   * @constructor
   */
  async guestUserInfo(params) {
    return await Axios.get({
      url: conf.UrlList.guestUserInfo,
      data: params
    })
  }
  

  /**
   *
   * @param params
   * @returns socket准备接口
   * @constructor
   */
  async socketServe(params) {
    return await Axios.chatPost({
      url: conf.UrlList.chatWoSever,
      data: params
    })
  }

  /**
   *
   * @param params
   * @returns 消息置为已读
   * @constructor
   */
  async chatEdPersons(params) {
    return await Axios.chatPost({
      url: conf.UrlList.chatEdPersons,
      data: params
    })
  }
  /**
   *
   * @param params
   * @returns 客服聊天记录详情
   * @constructor
   */
  async chatMassageList(params) {
    return await Axios.chatGet({
      url: conf.UrlList.chatMassageList,
      data: params
    })
  }
  /**
   *
   * @param params
   * @returns 推送到门店
   * @constructor
   */
  async chatPUshShop(params) {
    return await Axios.chatPost({
      url: conf.UrlList.chatPUshShop,
      data: params,
    })
  }
  /**
   *
   * @param params
   * @returns 转接客服
   * @constructor
   */
  async chatTrans(params) {
    return await Axios.chatPost({
      url: conf.UrlList.chatTrans,
      data: params
    })
  }
  /**
   *
   * @param params
   * @returns 结束服务
   * @constructor
   */
  async chatSession(params) {
    return await Axios.chatPost({
      url: conf.UrlList.chatSession,
      data: params
    })
  }
  /**
   *
   * @param params
   * @returns 拉黑用户结束服务
   * @constructor
   */
  async chatBlock(params) {
    return await Axios.chatPost({
      url: conf.UrlList.chatBlock,
      data: params
    })
  }
  /**
   * @param params
   * @returns 上传文件
   * @constructor
   */
  async uploadFiles(params) {
    return await Axios.chatPost({
      url: conf.UrlList.uploadFiles,
      data: params,
      contentType: 'multipart/form-data'
    })
  }
  

}


export default new ProductCS()
